Playback apparatus and playback method

ABSTRACT

Noise is prevented when decoding an audio stream not containing syncwords or CRC bits in the elementary stream. When decoding a current frame, the private header of the next frame is analyzed and the current frame is muted if the private header of the next frame is not valid. When there is a data discontinuity caused by editing, decoding resumes from the start address of the next frame determined.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates generally to an audio playback apparatusfor decoding and reproducing an audio signal encoded in frames, andrelates more specifically to a playback apparatus and playback methodfor reproducing audio without producing noise when attributes change orthere is a data discontinuity in the audio signal due to editing or acommunication error.

2. Background Art

Playback methods for decoding and presenting audio signals encoded asdigital code streams are widely available today in the form of playbackdevices and computer programs for listening to music and other audiocontent. In most such implementations the audio signal is encoded inaudio data frames according to the MPEG standard, particularly ISO11172-3 or ISO 13818-3. A private header containing signal attributes isadded to each frame. A CRC bit for error checking is also added to theencoded audio signal, thus enabling checking during the decoding processfor data errors and data loss on the transmission path.

However, when data loss on the transmission path is high, resulting indiscontinuities in the data stream, error correction cannot restore thesignal. Outputting the audio signal with such data discontinuitiesproduces noise. To eliminate this noise, the audio is preferably muted.

An example of a conventional playback apparatus is taught in JapaneseUnexamined Patent Application Publication 2000-259195. Instead ofdetecting these signal discontinuities, this playback apparatus detectschanges in settings from the transmission side, such as changes in thesampling frequency in the data stream, and mutes audio output for apredetermined time after such a change is detected. When there is such achange, the receiver must automatically adjust to the changed setting,and mutes the audio output so that noise is not produced during theautomatic adjustment. This conventional playback apparatus detects avalid header and compares the sampling frequency written to the oneprevious valid header interpreted by a header interpreting means withthe sampling frequency written in the current valid header currentlybeing decoded. If the sampling frequency in the current header haschanged, audio is muted for a specific time in the frame following thesampling frequency change to prevent outputting noise.

If the sampling frequency written in the current header is differentfrom the sampling frequency in the preceding header, for example, theoperating parameters of the DA converter downstream from the decodingmeans must be changed. Furthermore, because a correct audio signal willnot be produced while the DA converter settings are being changed, theoutput audio signal will contain noise. As a result, audio output ismuted for the time required to change the DA converter settings. Audiois therefore muted for the frame containing the header with the changedsetting and one or more subsequent frames.

The header is detected by detecting a synchronization word (“syncword”),which is set and used for synchronization with the header.

This syncword is further described in Japanese Unexamined PatentApplication Publication 2000-31942.

Japanese Unexamined Patent Application Publication H10-209876 teaches amuting process that detects lost data by comparing the data size toapply muting. The conventional bitstream playback apparatus taught inJapanese Unexamined Patent Application Publication H10-209876 decodes anaudio stream encoded to the MPEG-1 or MPEG-2 Audio standard, detects aframe buffer underflow in the decoder when part of the bitstream is lostfor any reason, and thus mutes output. More specifically, this apparatusdetects the syncword to find valid headers, and counts the data betweenone valid header and another valid header. If the counted data size F isless than a predetermined size, data loss is detected and muting isapplied.

SUMMARY OF INVENTION

The elementary stream used by the present invention does not contain asyncword and has no bits for CRC or other type of error checking.Problems confronted when processing this type of elementary stream,however, include how to find discontinuities in the bitstream and when(what timing) to apply muting.

The problems with the methods and apparatuses cited above in this regardare described below.

Japanese Unexamined Patent Application Publications 2000-259195 and2000-31942 detects valid headers and interprets information written invalid headers, and thus cannot find discontinuities in the data betweenone header and the next header.

Japanese Unexamined Patent Application Publication H10-209876 detects avalid header and detects the amount of data between that valid headerand the next valid header. While valid headers can be found using thesyncword, two consecutive valid headers cannot be found when processinga stream that does not contain syncwords, that is, the type of stream towhich the present invention is directed.

Furthermore, muting is applied to frames following the header where achange is detected with the apparatus taught in Japanese UnexaminedPatent Application Publication 2000-259195. As a result, noise caused bydiscontinuities in the bitstream before a parameter change is detectedcannot be muted.

Yet further, Japanese Unexamined Patent Application PublicationH10-209876 also does not describe the timing at which muting is applied.

To resolve these problems, a playback apparatus according to the presentinvention receives data having a lower layer second stream contained inan upper layer first stream that includes a detectable header signal,the second stream containing an encoded audio signal and a privateheader storing attribute information for the encoded audio signal in oneframe but not containing a synchronization word, decodes the encodedaudio signal, and outputs audio. This playback apparatus has a streamanalyzing means for analyzing the first stream and detecting the headersignal, analyzing the second stream based on the detected header signal,and outputting the encoded audio signal and private header address; apre-decoding buffer memory for temporarily storing the encoded audiosignal and private header output from the stream analyzing means; adecoding means for decoding the encoded audio signal input from thepre-decoding buffer memory and outputting audio; a first headeranalyzing means for analyzing attribute information contained in theprivate header of a first frame, and detecting data length informationdenoting the data length of the encoded audio signal following theprivate header; a second header analyzing means for analyzing targetdata of a specified length starting from an address acquired by addingthe detected data length to the address of the private header of thefirst frame, and determining if the target data is the attributeinformation contained in the private header of a second frame; and acontrol means for stopping audio output from the decoding means for atleast the encoded audio signal of the first frame if the analyzed targetdata is determined to not be attribute information contained in theprivate header of a second frame.

Preferably, the second header analyzing means determines if at least apart of the target data matches at least a part of the attributeinformation interpreted by the first header analyzing means.

Alternatively, the second header analyzing means determines if at leasta part of the target data matches at least a part of a previously storedattribute information set.

The attribute information is preferably at least one of the following: asampling frequency of the encoded audio signal, channel information,audio sample bit length, and encoded audio signal data length.

Yet further preferably, the stream analyzing means detects frame lengthdata contained in the header signal denoting the length of the frame,and abandons the frame and analyzes the next frame when the length ofthe data in the one frame following the header signal is not equal tothe detected frame length data.

Alternatively, the first stream contains a plurality of packets, and thestream analyzing means detects packet length data contained in theheader signal denoting the packet length, and abandons a packet andanalyzes the next packet when the length of the detected packet is notequal to the detected packet length data.

Further preferably, a discontinuity identification packet is inserted inthe first stream where a data discontinuity occurs, and when the streamanalyzing means detects a discontinuity identification packet and thelength of data output to the pre-decoding buffer memory before thediscontinuity identification packet is less than a predefined datalength or integer multiple thereof, the stream analyzing means outputspadding data equal to the data deficiency to the pre-decoding buffermemory.

Alternatively, a discontinuity identification packet is inserted in thefirst stream where a data discontinuity occurs; and the stream analyzingmeans comprises a counter for counting from a detected header signal toa discontinuity identification packet. The playback apparatus also hasan address storage means for calculating and storing the address wherethe counter stops counting; and the control means moves a read pointerso that the next private header is located at the calculated address.

Yet further preferably, the playback apparatus also has a delay meansbetween the pre-decoding buffer memory and decoding means.

Another aspect of the present invention is a playback method forreceiving data having a lower layer second stream contained in an upperlayer first stream that includes a detectable header signal, said secondstream containing an encoded audio signal and a private header storingattribute information for the encoded audio signal in one frame but notcontaining a synchronization word, decoding said encoded audio signal,and outputting audio. This playback method has a stream analyzing stepfor analyzing the first stream and detecting the header signal,analyzing the second stream based on the detected header signal, andoutputting the encoded audio signal and private header address; a stepfor temporarily storing the encoded audio signal and private headeroutput from the stream analyzing step; a decoding step for decoding thestored encoded audio signal and outputting audio; a first headeranalyzing step for analyzing attribute information contained in theprivate header of a first frame, and detecting data length informationdenoting the data length of the encoded audio signal following theprivate header; a second header analyzing step for analyzing target dataof a specified length starting from an address acquired by adding thedetected data length to the address of the private header of the firstframe, and determining if said target data is the attribute informationcontained in the private header of a second frame; and a control stepfor stopping audio output from the decoding step for at least theencoded audio signal of the first frame if the analyzed target data isdetermined to not be attribute information contained in the privateheader of a second frame.

Preferably, the second header analyzing step determines if at least apart of the target data matches at least a part of the attributeinformation interpreted by the first header analyzing step.

Alternatively, the second header analyzing step determines if at least apart of the target data matches at least a part of a previously storedattribute information set.

The attribute information is preferably at least one of the following: asampling frequency of the encoded audio signal, channel information,audio sample bit length, and encoded audio signal data length.

Further preferably, the stream analyzing step detects frame length datacontained in the header signal denoting the length of the frame, andabandons the frame and analyzes the next frame when the length of thedata in the one frame following the header signal is not equal to thedetected frame length data.

Alternatively, the first stream contains a plurality of packets, and thestream analyzing step detects packet length data contained in the headersignal denoting the packet length, and abandons a packet and analyzesthe next packet when the length of the detected packet is not equal tothe detected packet length data.

Further preferably, a discontinuity identification packet is inserted inthe first stream where a data discontinuity occurs, and when the streamanalyzing step detects a discontinuity identification packet and thelength of data stored before the discontinuity identification packet isless than a predefined data length or integer multiple thereof, thestream analyzing step outputs padding data equal to the data deficiencyto the pre-decoding buffer memory.

Alternatively, a discontinuity identification packet is inserted in thefirst stream where a data discontinuity occurs; and the stream analyzingstep counts from a detected header signal to a discontinuityidentification packet. This playback method also has an address storagestep for calculating and storing the address where counting stops; andthe control step moves a read pointer so that the next private header islocated at the calculated address.

Yet further preferably, the playback method also has a delay step fordelaying the encoded audio signal between the storing step and decodingstep.

A further aspect of the present invention is a program for executing theplayback method of the invention on a computer.

Another aspect of the present invention is a computer-readable recordingmedium for recording a program for executing the playback method of theinvention on a computer.

A playback apparatus according to the present invention can output audiowithout producing noise when decoding an audio stream not containingsyncwords or CRC bits in the elementary stream even when there is adiscontinuity in the bitstream due to editing or data is lost due to anerror on the transmission path.

Other objects and attainments together with a fuller understanding ofthe invention will become apparent and appreciated by referring to thefollowing description and claims taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of an audio playback apparatus according to afirst embodiment of the present invention;

FIG. 2A is a flow chart of an audio playback method according to a firstembodiment of the present invention;

FIG. 2B is a flow chart of an audio playback method according to a firstembodiment of the present invention;

FIG. 3 shows the structure of an MPEG bitstream;

FIG. 4 shows the structure of a bitstream edited at the transport streampacket unit level;

FIG. 5A is a block diagram of an audio playback apparatus according to afirst embodiment of the present invention;

FIG. 5B is a block diagram of an audio playback apparatus according to afirst embodiment of the present invention;

FIG. 6 is a block diagram of an audio playback apparatus according to asecond embodiment of the present invention;

FIG. 7A is a flow chart of an audio playback method according to asecond embodiment of the present invention;

FIG. 7B is a flow chart of an audio playback method according to asecond embodiment of the present invention;

FIG. 8 is a block diagram of an audio playback apparatus according to athird embodiment of the present invention;

FIG. 9A is a flow chart of an audio playback method according to a thirdembodiment of the present invention; and

FIG. 9B is a flow chart of an audio playback method according to a thirdembodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

A first embodiment of the present invention is described below withreference to FIG. 1, FIG. 2A, FIG. 2B, FIG. 3, FIG. 4, FIG. 5A, and FIG.5B.

FIG. 1 is a block diagram of an audio playback apparatus 101 accordingto a first embodiment of the present invention. FIG. 2A and FIG. 2B area flow chart showing the steps of a playback method used in this firstembodiment of the invention. FIG. 3 shows the structure of the bitstreaminput to the audio playback apparatus 101, and more particularly showsthe transport stream and PES packet in an MPEG bitstream, and thestructure of the elementary stream processed by the present invention toprevent noise. FIG. 4 shows an example of the bitstream in which thetransport stream shown in FIG. 3 is edited at the transport packet leveland contains incomplete PES packets.

The process whereby the transport stream 301 is produced on thetransmission side is described briefly first.

The source audio signal is converted to an encoded audio signal 308 by aspecific encoding method, segmented into blocks of a specified bytelength (such as 960 bytes or 1440 bytes), and a four-byte private header307 is then added to the first block. This encoded audio signal isassumed herein to be uncompressed PCM data. Each segment of the encodedaudio signal 308 contains an approximately 5 msec long audio signal. Theprivate header 307 contains attribute information for the encoded audiosignal 308, and does not contain a syncword. The private header 307 andfollowing encoded audio signal 308 together form one audio frame, and astream containing a series of consecutive frames is called an elementarystream 306.

The audio signal attribute data includes, for example, the samplingfrequency, channel information, bit length of the samples, and the datalength of the encoded audio signal 308. The attribute data does notchange unless any of the attributes (that is, the sampling frequency,channel information, bit length of the samples, and the data length ofthe encoded audio signal 308 in this example) change. Therefore, unlessthe attribute data changes, the private header 307 of the n-th frame(where n is a positive integer) and the private header 307 of the(n+1)-th frame are the same. Normally there is very little change in theattribute information. The attribute information also includesattributes that change infrequently (including never) and attributesthat change frequently. In addition, some attributes that change onlychange between a number of predefined options. For example, the datalength of the encoded audio signal 308 has two predefined choices, 960bytes and 1440 bytes.

This elementary stream 306 is divided into frame units, which arewritten to the PES payload 305. The PES payload 305 is thus 964 bytes or1444 bytes long. A PES header 304 is added to each PES payload 305, thusproducing a PES packet 303.

Each PES packet 303 is then segmented into units of a defined length(188 bytes or 184 bytes), and each of these units is called an audiotransport packet 302.

The audio transport packets 302 are combined with video transportpackets and other transport packets in the transport stream 301.

The transport stream 301 is broadcast from the transmission station. Thereceiver receives the transport stream 301, and the audio playbackapparatus 101 reproduces the audio from the transport stream 301.

The received transport stream 301 could be sent directly to the audioplayback apparatus 101, or recorded to some recording medium from whichthe transport stream 301 is then read and sent to the audio playbackapparatus 101 for audio playback. This latter case includes sending anaudio transport stream recorded by an audio recording and reproducingapparatus to the audio playback apparatus 101 for playback, and sendingcommercial content recorded to a disc (such as a DVD) as a transportstream to the audio playback apparatus 101 for playback.

As described above, the present invention processes a data structure inwhich a lower layer second stream (elementary stream), that does notcontain a syncword but includes an encoded audio signal and a privateheader storing attributes of the encoded audio signal in one frame, iscontained in an upper layer first stream (the PES packet stream) thatincludes a detectable header signal (PES header).

A data discontinuity detection unit 100 detects whether there are anypacket discontinuities in the stream or any data discontinuities in thepackets of the received stream, that is, whether any data was lost, andinserts a discontinuity identification packet 401 if a discontinuity isfound.

The audio playback apparatus 101 decodes the input transport stream 301containing audio transport packets 302 and outputs an audio signal. Thetransport stream 301 input to the audio playback apparatus 101 is inputto the stream analyzing means 102 (S201). The stream analyzing means 102analyzes the transport stream 301, extracts the audio transport packets302 and assembles the PES packets 303, and then analyzes the PES packets303 (S202).

As shown in FIG. 3, the stream analyzing means 102 extracts only theaudio transport packets 302 from the transport stream packet stream, andassembles the PES packet 303 stream. The PES header 304 contains thedata length of the PES payload 305. Once the PES header 304 is detected,the stream analyzing means 102 therefore starts counting from thebeginning of the PES payload immediately following the PES header, andstops counting when the next packet (either PES packet or thediscontinuity identification packet described below) is found. If thereis no data discontinuity, this count will equal the data length of thePES payload 305. The count is therefore compared with the data lengthvalue read from the PES header to determine if the count matches apredefined valid value (S203). If the values do not match, that is, ifthe data length is not valid (S203 returns INVALID), the PES packetbeing analyzed is dropped and the next PES packet is analyzed.

Note that the data length of the PES payload is one of multiple valuespredefined by the coding standard, and in this example is either 964bytes or 1444 bytes.

If the data length is valid (S203 returns VALID), the private header 307and encoded audio signal 308 are extracted from the PES payload 305 andstored to the pre-decoding buffer 103 (S204). Note that the PES payload305 is also referred to herein as the elementary stream 306. The privateheader 307 also includes the attributes of the encoded audio signal 308,but does not contain a syncword. The private header 307 is detectedafter a specified delay from PES header 304 detection, for example. Inthe example shown in FIG. 3, the private header 307 is located directlyafter the PES header 304, but the private header 307 could be located aspecified distance from the end of the PES header 304. In this case, thePES header also contains information indicating the distance from theend of the PES header 304 to the private header 307.

The stream analyzing means 102 thus functions to analyze the streamcontaining the PES packets, that is, the first stream, and detect theheader signal (PES header), and analyze the second stream (elementarystream) based on the detected header signal to output the encoded audiosignal and private header location information.

Note, further, that the transport stream 301 is input to the audioplayback apparatus 101 in this example, but the invention shall not beso limited and the audio PES packets 303 could be input. In this case,the stream analyzing means 102 still stores the private header 307 andencoded audio signal 308 of the elementary stream 306 to thepre-decoding buffer 103. Note also that transport stream 301 analysisand PES packet 303 analysis are shown in one step S202 in FIG. 2A forclarity.

The encoded audio signal 308 output from the pre-decoding buffer 103 isthen input to the first header analyzer 105, second header analyzer 106,and frame delay 111. The frame delay 111 delays the received encodedaudio signal 308 at least one frame before passing the encoded audiosignal 308 to the decoder 104.

The first header analyzer 105 detects and reads the private header 307in the first frame stored to the pre-decoding buffer 103, and analyzesand outputs the information contained in the private header 307 to thecontrol means 107 (S205).

The private header 307 is detected at a specified time after the PESheader 304 detected by the stream analyzing means 102, for example. Theinformation contained in the private header 307 is the attributeinformation for the encoded audio signal, including, for example, thesampling frequency, channel information, bit length of the audiosamples, and the data length of the encoded audio signal 308. All orpart of the attribute information is output to the control means 107.

The first header analyzer 105 detects the n-th private header 307 (4bytes), and sends the detected n-th private header 307 to the controlmeans 107. The control means 107 stores all or part of the informationin the n-th private header 307 (that is, the sampling frequency, channelinformation, bit length of the audio samples, and the data length of theencoded audio signal 308) in the private header memory 110.

The first header analyzer 105 also counts time Tf, which is equivalentto the length of one frame, from the beginning of the detected n-thprivate header 307, and then sends a trigger signal to the second headeranalyzer 106. The first header analyzer 105 could alternatively send thetrigger signal after counting m frames (where m is a positive integergreater than 1) instead of counting only one frame.

This time Tf is determined by adding the private header length (4 bytes)to the data length of the encoded audio signal 308, which is included inthe attribute data. Counting is done by counting the data length of theencoded audio signal 308 from the end of the private header 307.

As will be known from the foregoing description, the first headeranalyzer 105 analyzes the attribute information contained in the privateheader of the first frame, and detects the data length informationdenoting the length of the encoded audio signal following the privateheader.

In response to the trigger signal, the second header analyzer 106 readsa part (4 bytes) of the elementary stream data output from thepre-decoding buffer 103, that is, reads the target data. If there is nodiscontinuity in the encoded audio signal, the read target data will bethe (n+1)-th private header. If there is a discontinuity in the n-thframe data, the read target data will not be the (n+1)-th privateheader, and the (n+1)-th private header can therefore not be readcorrectly.

The second header analyzer 106 compares the read 4-byte target data withthe private header stored in the private header memory 110. If thetarget data and the stored private header are the same, the secondheader analyzer 106 knows that the (n+1)-th private header is in thecorrect position, that is, that the n-th frame is neither longer norshorter than the correct length. The control means 107 thereforeproceeds with audio decoding.

However, if the target data does not match the private header stored inthe private header memory 110, the second header analyzer 106 knows thatthe (n+1)-th private header is not in the correct position, thereforeknows that there is a discontinuity in the encoded audio signal, andknows that some audio data is missing. The control means 107 thereforeoutputs a mute signal to the decoder 104 in order to mute the encodedaudio signal following the n-th private header. Because a frame delay111 is provided, the mute signal will be output immediately before thedecoder 104 outputs the audio for the encoded audio signal following then-th private header. The decoder 104 thus mutes the encoded audio signalfollowing the n-th private header, and stops audio output. The mutesignal mute the audio for one frame period. As a result, audio outputresumes from the encoded audio signal following the (n+1)-th privateheader.

As will be known from the foregoing description, the second headeranalyzer 106 analyzes target data of a specific length following theposition determined by adding the detected frame length to the locationof the private header in the first frame, and determines if the analyzedtarget data is the attribute information contained in the private headerof the second frame.

Whether this target data is the attribute information contained in theprivate header of the second frame can be determined by detecting if atleast a part of the target data matches at least a part of the attributeinformation analyzed by the first header analyzer 105 from the firstframe.

Furthermore, the mute signal could be a signal for muting a plurality offrame periods, such as a signal for muting two frame periods. If themute signal mutes audio output for two frame periods, audio output isinterrupted to mute the encoded audio signal following the (n+1)-thprivate header, and audio output resumes from the encoded audio signalfollowing the (n+2)-th private header.

The private header memory 110 could also be rendered in the first headeranalyzer 105.

It will also be obvious that the control means 107 could calculate theheader address instead of the first header analyzer 105.

Similarly to the first header analyzer 105, the second header analyzer106 analyzes the private header 307 and outputs the informationcontained therein to the control means 107 (S207). The second headeranalyzer 106 differs from the first header analyzer 105 in that thesecond header analyzer 106 reads data at the trigger signal from thefirst header analyzer 105, and analyzes the private header in a framechronologically after the private header analyzed by the first headeranalyzer 105, specifically the private header of the next frame in thisexample. In this example, therefore, the second header analyzer 106analyzes the private header of the next frame after the current framebeing decoded by the decoder 104.

The decoder 104 reads the encoded audio signal 308 output ROM thepre-decoding buffer 103 after a specific delay, and outputs the audio(S209). The control means 107 controls audio output from the decoder104, specifically starting and stopping decoding and muting audiooutput.

The control means 107 receives the private header information for thecurrent and next frames from the first header analyzer 105 and secondheader analyzer 106 and compares the received information as describedabove (S208). If the compared information is not the same, the controlmeans 107 instructs the decoder 104 to mute audio output (S210).

The playback apparatus and playback method according to this embodimentof the invention detect if sufficiently more than one frame of theencoded audio signal data has accumulated in the pre-decoding buffer(S211) so that the next frame can be decoded after outputting the audiosignal from the first frame. If sufficient data is buffered (S211returns yes), the procedure loops back to step S205 for the first headeranalyzer 105 to analyze the attribute information in the first frame,and decoding continues. If sufficient data is not stored in the buffer(S211 returns no), the procedure loops back to step S201 for streaminput from an external source, and operation continues from streamanalysis by the stream analyzing means 102 (S202).

Operation when the transport stream 301 has been edited at the transportpacket level is described next with reference to FIG. 4.

When there is a discontinuity in the transport stream input to the audioplayback apparatus 101 due to editing, for example, the datadiscontinuity detection unit 100 inserts a discontinuity identificationpacket 401 at the place where the discontinuity was detected. The streamanalyzing means 102 then analyzes the input stream as described above(S202), and writes the audio elementary stream to the pre-decodingbuffer 103 (S204). If a discontinuity identification packet 401 has beeninserted, the encoded audio signal extracted from the stream will be anincomplete encoded audio signal 403 containing no data in the later partof the signal.

The first header analyzer 105 then adds the data length of a validencoded audio signal contained in the first header analyzer 105 to theend address of the current private header, and thus calculates address B407 (S206). Because of this incomplete encoded audio signal 403,however, address B 407 is at a point later than the actual address A 406of the next private header. When the first header analyzer 105 thenoutputs the trigger signal at the timing of address B, the second headeranalyzer 106 reads the specified length of data (4 bytes) from address Bas described above, and runs the private header analysis processexpecting to find the next private header (S207). However, because thespecified amount of data (4 bytes in this example) stored from address Bis either part of the encoded audio signal or part of the private headerand part of the encoded audio signal, the private header cannot becorrectly interpreted. As a result, the information read by the secondheader analyzer 106 does not match the attribute information acquired bythe first header analyzer 105 and stored in the private header memory110, and a mismatch results (S208 returns no). If the encoded audiosignal is PCM data, the data read by the second header analyzer 106could possibly match the private header data from the first frame, butthis would be very rare.

Because of the detected data mismatch, the current frame related to thecurrent private header 404 is muted before the audio is output from thedecoder 104 (S210). As a result, the incomplete encoded audio signal 403and if necessary the encoded audio signal following in the next frameare neither decoded nor output, and the output of audio noise is thusprevented.

Another evaluation method run by the control means 107 is described nextwith reference to FIG. 5A and FIG. 5B. The private header memory 110 inthis method does not store the attribute information read from thedetected private header (that is, the sampling frequency, channelinformation, bit length of the audio samples, and the data length of theencoded audio signal 308), but instead stores the complete set ofselectable attribute information, including variations. Morespecifically, the private header memory 110 stores information such asshown in Table 1 below.

TABLE 1 d: a: c: data length of sampling b: bit length encoded audiofrequency audio type of sample signal (a1) 32 kHz (b1) mono (c1) 16 (d1)960 bytes (a2) 44.1 kHz (b2) stereo (c2) 20 (d2) 1440 bytes (a3) 48 kHz(b3) dual mono (c3) 24 (d3) 5760 bytes

The information actually contained in the private header includes onevalue from each of columns a to d, for example, (a2, b1, c1, d2).

The control means 107 compares the attribute information detected fromthe current private header and the attribute information set previouslystored in the private header memory 110 (that is, the data in Table 1),and determines if information matching the detected attributeinformation is stored in private header memory 110 (S507). That is, ifall of the detected attributes (a2, b1, c1, d2) are included in theattribute information set stored in the private header memory 110, thecontrol means 107 determines that the information is valid. However, ifany one of the values in the detected attribute information is notincluded in the attribute information set stored in the private headermemory 110, the control means 107 determines that the information is notvalid. For example, if the detected attributes are (xx, b1, c1, d2)(where xx denotes information that cannot be interpreted as an attributevalue), the private header is determined to be invalid.

The four bytes of target data following the length of the expectedencoded audio signal 308 from the end of the current private header,that is, the information detected from the location where the nextprivate header should be located, is then compared with the previouslystored attribute information using the same method applied in step S507(S508). If all of the detected attributes are included in the attributeinformation set stored in the private header memory 110, the informationis valid and the audio is reproduced (S509). However, if any one of thedetected attribute values does not match the previously stored attributeinformation, the decoder 104 is instructed to mute the audio output(S510).

The step of determining if the PES payload length is correct (step S203shown in FIG. 2A) is omitted in FIG. 5A for clarity, but it will beobvious to one with ordinary skill in the related art that the PESpayload length can be evaluated as described above after the streamanalysis step (S502).

Furthermore, because whether to mute the audio output can be determinedbased on whether the next private header is in the correct location ornot, decision diamond S507 can be omitted. In this case, only theattribute information detected from the next private header is comparedfor a match with the previously stored attribute information (S508). Thecurrent private header is detected and interpreted to determine thestarting point for counting to the next private header and the distanceto the next private header. The next private header is analyzed todetermine if the data detected as the next private header is a correctlyformed private header.

As described above, the second header analyzer determines if the targetdata is the attribute information contained in the private header of thesecond frame, but this determination could be based on whether at leasta part of the target data matches at least a part of the previouslystored attribute information set.

Storing an attribute information set such as shown in Table 1 preventsdetermining that the detected attributes are wrong when the attributesare changed within the allowed range.

Note that because the private header 307 in an audio stream framegenerally includes attributes relating to the encoded audio signal 308following thereafter, the last frame in the stream may not contain anydata to be analyzed by the second header analyzer 106.

In this case, the stream analyzing means 102 adds predefined dummy datato the end of the stream. This dummy data could be, for example, atypical combination of the attribute information shown in Table 1, suchas (a1, b1, c1, d1). The purpose of this dummy data is to ensure thatall of the attribute information in the next frame acquired by thesecond header analyzer 106 matches a predefined bit sequence, and thusprevent the control means 107 from instructing the decoder 104 to mutethe audio output. This effectively avoids the second header analyzer 106being unable to interpret any data because a buffer underflow occurswhen the decoder reads data from the pre-decoding buffer 103 as a resultof there being no data to be interpreted by the second header analyzer106 at the expected address at the end of the input stream.

More specifically, a buffer underflow is avoided by the stream analyzingmeans 102 adding a private header containing predefined valid attributeinformation, and the last frame can therefore be decoded and output. Thepredefined attribute information could be, for example, only a samplingfrequency of 48 kHz; or a sample bit length of 16 bits, 20 bits, or 24bits; or an audio type of monaural, dual monaural, or stereo; or anencoded audio signal data length of 960 bytes or 1440 bytes. Thespecific bit sequence added to the end of the bit stream is any bitsequence that will not be mistaken for the attribute information.Alternatively, the specific bit sequence added to the end of the bitstream could be a bit sequence representing the predefined validattribute information.

This embodiment of the invention prevents producing audio noise bymuting the encoded audio signal of the first frame when part of theencoded audio signal in the first frame, which is the data between theprivate header of a first frame and the private header of a secondframe, is missing due to a transmission error, for example.

A second embodiment of the present invention is described next withreference to FIG. 6, FIG. 7A, and FIG. 7B.

This second embodiment of the invention differs from the first in that apacket length counter 608 is also provided. This packet length counter608 continually counts the length of data stored in pre-decoding buffer103 (S705). If the counted length of the PES payload is less than afirst specified length (S706 returns no), control returns to the streaminput step (S701).

After interpreting the transport stream TS and PES header (S702), thisembodiment of the invention determines if a discontinuity identificationpacket is present (S703). If a discontinuity identification packet isdetected (S703 returns yes), whether the length of the elementary streamstored in the pre-decoding buffer 103 is an integer multiple of a secondspecified length is determined (S707). If not (S707 returns no), paddingdata is stored to the pre-decoding buffer 103 so that the amount of datastored in the pre-decoding buffer 103 is an integer multiple of thesecond specified length (S708). The packet length counter 608 is thenreset (S716) and operation returns to the stream input step S701.

If a discontinuity identification packet is not detected (S703 returnsno), the elementary stream is stored to the pre-decoding buffer 103(S704) and the packet length counter 608 counts the length of the storeddata (S705).

The packet length counter 608 counts the length of the PES payload(S705). More specifically, the packet length counter 608 counts how muchdata is stored to the pre-decoding buffer 103 between when the streamanalyzing means 102 detects the header of a first audio PES packet (thePES header) (S702) and detects the header of the next PES header.

If the stream analyzing means 102 detects a discontinuity identificationpacket while interpreting the transport stream TS or PES header (S703returns yes), the stream analyzing means 102 determines if the datastored to the pre-decoding buffer 103 by that time is the integermultiple of the second specified length (S707). If not (S707 returnsno), padding data is stored to the pre-decoding buffer 103 so that theamount of data stored in the pre-decoding buffer 103 is the integermultiple of the second specified length (S708). The packet lengthcounter 608 is then reset (S716) and operation returns to the streaminput step S701. When operation returns to step S701, the read addressof the first header analyzer 105 in the pre-decoding buffer 103 is resetto the next address after the address to which the padding data wasstored, that is, to the address of the beginning of the data followingthe discontinuity identification packet.

The predefined first specified length used in this process is, forexample, 968 bytes or 1448 bytes, that is, an amount equal to the firstprivate header (4 bytes), the length of the encoded audio signal (940bytes or 1440 bytes), and the second private header (4 bytes).

The second specified length is the smallest unit of data (normallycalled a “word”) that can be accessed by the first header analyzer 105,second header analyzer 106, and decoder 104 when reading data stored inthe pre-decoding buffer 103, and in this example is 4 bytes.

The elementary stream output from the pre-decoding buffer 103 isinterpreted by the first header analyzer 105 as described above (S709),the location of the second header is calculated (S710), and the targetdata at the second header location (that is, the data expected to be thesecond header) is interpreted (S711). The content of the interpretedtarget data is compared with the content of the first header todetermine if they match (S712). If they are the same, the target datacontent is recognized as a valid second header, and the audio isreproduced and output (S713). However, if the content of the secondheader differs from the content of the first header in any part, thetarget data content is not recognized as a correctly formed secondheader. More specifically, the location of the second header is known tobe offset from the calculated second header address. In this case, as inthe first embodiment, the encoded audio signal following the firstheader is muted (S714).

Whether a specified amount of data (which is greater than or equal tothe first specified length) is stored in the pre-decoding buffer 103 isthen determined (S715). If the data is buffered (S715 returns yes),operation returns to step S709, otherwise operation returns to stepS701.

Step S712 above compares the content of the interpreted target data withthe content of the interpreted first header and determines if theymatch. Step S712 could, however, compare the content of the interpretedtarget data with the content of previously stored data such as shown inTable 1.

When the stream is edited at the transport packet level such that datais removed from the PES payload, that is, the private header of theaudio and the encoded audio signal are incompletely formed, theforegoing process prevents the incomplete PES payload, i.e., theincomplete audio frame, from being decoded. An incomplete encoded audiosignal preceding the edited segment and the following data are thusprevented from being input to the decoder 104, and noise is thusprevented.

If an incomplete encoded audio signal is not decoded by the decoder 104,the second header analyzer 106 does not need to interpret the next frame(S711) and the control means 107 does not need to verify the attributeinformation of the next frame (S712). The second header analyzer 106 isprovided, however, to detect if data has been dropped in transmissionbetween the stream analyzing means 102 and pre-decoding buffer 103, andto prevent noise when an illegal encoded audio signal is somehow inputin PES packets of the normal length.

Alternatively, when the packet length counted by the packet lengthcounter 608 is not an integer multiple of the specified data length(S707 returns no), the stream analyzing means 102 in this secondembodiment of the invention could add padding data so that the packetlength equals an integer multiple of the specified data length (S708)and the word length is aligned, and then store the padded stream to thepre-decoding buffer 103. The decoder 104, first header analyzer 105, andsecond header analyzer 106 generally read data from the pre-decodingbuffer 103 in predefined word units. For example, four bytes could beread as one word.

When the bitstream is edited at the transport packet level, thebitstream is generally not edited in 4-byte units. As a result, theframe following the point at which the stream was edited is stored tothe pre-decoding buffer 103 without the expected word alignment. In thiscase, the data near the private header read by the first header analyzer105 and second header analyzer 106 after the edited point is shifted 1to 3 bytes, and the control means 107 cannot correctly detect theattribute information. This is because the elementary stream to whichthe present invention is directed does not contain a syncword, and thefirst header analyzer 105 and second header analyzer 106 thereforecannot detect the 1 to 3 byte offset in the word alignment and thuscorrect the read address. The stream analyzing means 102 therefore addspadding data when storing data to the pre-decoding buffer 103 (S708),and thus enables decoding and audio output.

The foregoing process is shown in FIG. 7A and FIG. 7B. When adiscontinuity identification packet 401 is detected during PES packetanalysis, control returns to the PES packet interpreting step S702. Ifthe size of the PES packet stored to the pre-decoding buffer 103 doesnot equal a first specified length, that is, does not equal an integermultiple of the length of one frame of the elementary stream 306 (S706returns no), the procedure loops back to the stream input step S701. Inaddition, if the size of the PES packet stored to the pre-decodingbuffer 103 does not equal a second specified length (S707 returns no),padding data is stored to the pre-decoding buffer 103 (S708) to alignthe pointer for accessing data in the pre-decoding buffer 103 with afull word.

The stream analyzing means in this embodiment of the invention can thusdetect data discontinuities in the stream and thereby prevent outputtingnoise, and can decode the bitstream following a detected discontinuityand reproduce the audio content by aligning the data words at the datadiscontinuity.

The step of determining if the PES payload length is correct (step S203shown in FIG. 2A) is omitted in FIG. 7A for clarity, but it will beobvious to one with ordinary skill in the related art that the PESpayload length can be evaluated as described above after the streamanalysis step (S702).

A third embodiment of the present invention is described next withreference to FIG. 8, FIG. 9A, FIG. 9B, and FIG. 4. This third embodimentof the invention relates to resuming audio output after a point wherethe bitstream has been edited. This point is referred to herein as the“edited point.”

This third embodiment differs from the first and second embodiments byfurther comprising an address storage means 808 (see FIG. 8) for storingthe address of the private header stored by the stream analyzing means102 to the pre-decoding buffer 103.

After the bitstream is input (S901), the transport stream TS and PESheader are interpreted (S902). The PES header is then read and whether adiscontinuity identification packet 401 is detected while interpretingthe PES header is determined (S903). If a discontinuity identificationpacket 401 is found, control goes to step S904. If the next PES headeris detected without finding a discontinuity identification packet 401(or if a discontinuity identification packet 401 while counting aspecific length from the previous PES header), control goes to stepS905. The elementary stream is stored to the pre-decoding buffer 103 instep S905.

Steps S903 and S904 are described further with reference to FIG. 4. Instep S903 the stream analyzing means 102 detects and interprets the PESheader. A counter in the stream analyzing means 102 starts counting fromthe end of the PES header and continues counting until the next packetis found (a discontinuity identification packet if there is adiscontinuity in the data, and the next PES packet if there is not adiscontinuity in the data). When interpreting the PES header, the lengthof the PES payload following the PES header could be detected, and thedetected data length used to control counting. Address A at whichcounting ends is then calculated. This address A is stored to theaddress storage means 808 (S904). The starting address of the firstprivate header found after an edited point is thus stored to the addressstorage means 808.

As described above, the elementary stream output from the pre-decodingbuffer 103 is then interpreted by the first header analyzer 105 (S906)and the location of the second header is calculated (S907). The targetdata at this second header location (that is, the data expected to bethe second header) is then interpreted (S908). The target data contentis then compared with the content of the first header to determine ifthey match (S909). If they match, the target data content is recognizedas a valid second header, and the audio is reproduced and output (S910).If the content of the second header differs from the content of thefirst header in any part, the target data content is the target datacontent is not recognized as a correctly formed second header. Morespecifically, the location of the second header is known to be offsetfrom the calculated second header address. In this case, as in the firstembodiment, the encoded audio signal following the first header is muted(S911).

The read pointer is also reset so that the beginning of the next privateheader 405 is set to address A stored in the address storage means 808(S912), and decoding continues. More specifically, address A is readfrom the address storage means 808, and the read pointers of the firstheader analyzer 105 and decoder 104 are moved to the starting address ofthe next header and frame (S912). By thus moving the read pointer thenext private header 405 is processed as the foregoing current privateheader 404, and the next private header thereafter is processed as thenext private header.

Whether a specified amount of data (which is greater than or equal tothe first specified length) is stored in the pre-decoding buffer 103 isthen determined (S913). If the data is buffered (S913 returns yes),operation returns to step S906, otherwise operation returns to stepS901.

Step S909 above compares the content of the interpreted target data withthe content of the interpreted first header and determines if theymatch. Step S909 could, however, compare the content of the interpretedtarget data with the content of previously stored data such as shown inTable 1.

As described above, the stream analyzing means 102 has a counter forcounting from a detected header signal to a discontinuity identificationpacket, and a address storage means 808 calculates and stores theaddress A where counting stops. The control means 107 then moves theread address so that the next private header is located at thecalculated address A.

The step of determining if the PES payload length is correct (step S203shown in FIG. 2A) is omitted in FIG. 9A for clarity, but it will beobvious to one with ordinary skill in the related art that the PESpayload length can be evaluated as described above after the streamanalysis step (S902).

This embodiment of the present invention can thus decode and outputaudio following a data discontinuity caused by editing, for example.

The foregoing embodiments of the present invention are described as thesteps of an audio playback apparatus and process, but it will be obviousto one with ordinary skill in the related art that these steps could beexecuted as part of a computer program or as functional parts of adifferent apparatus.

Furthermore, the present invention realized as a computer program can bestored to recording media such as a magnetic disk, CD-ROM, or othermedium, and thereby easily implemented using a computer system.

INDUSTRIAL APPLICABILITY

The present invention can be used in a playback apparatus or playbackmethod.

Although the present invention has been described in connection with thepreferred embodiments thereof with reference to the accompanyingdrawings, it is to be noted that various changes and modifications willbe apparent to those skilled in the art. Such changes and modificationsare to be understood as included within the scope of the presentinvention as defined by the appended claims, unless they departtherefrom.

1. A playback apparatus for receiving data having a lower layer secondstream contained in an upper layer first stream that includes adetectable header signal, the second stream containing an encoded audiosignal and a private header storing attribute information for theencoded audio signal in one frame but not containing a synchronizationword, decoding the encoded audio signal, and outputting audio, saidplayback apparatus comprising: a stream analyzing means for analyzingthe first stream and detecting the header signal, analyzing the secondstream based on the detected header signal, and outputting the encodedaudio signal and private header address; a pre-decoding buffer memoryfor temporarily storing the encoded audio signal and private headeroutput from said stream analyzing means; a decoding means for decodingthe encoded audio signal input from said pre-decoding buffer memory andoutputting audio; a first header analyzing means for analyzing attributeinformation contained in the private header of a first frame, anddetecting data length information denoting the data length of theencoded audio signal following the private header; a second headeranalyzing means for analyzing target data of a specified length staffingfrom an address acquired by adding the detected data length to theaddress of the private header of the first frame, and determining if thetarget data is the attribute information contained in the private headerof a second frame; and a control means for stopping audio output fromsaid decoding means for at least the encoded audio signal of the firstframe if the analyzed target data is determined to not be attributeinformation contained in the private header of a second frame.
 2. Aplayback apparatus as described in claim 1, wherein said second headeranalyzing means determines if at least a part of the target data matchesat least a part of the attribute information analyzed by said firstheader analyzing means.
 3. A playback apparatus as described in claim 1,wherein second header analyzing means determines if at least a part ofthe target data matches at least a part of a previously stored attributeinformation set.
 4. A playback apparatus as described in claim 1,wherein the attribute information is at least one of the following: asampling frequency of the encoded audio signal, channel information,audio sample bit length, and encoded audio signal data length.
 5. Aplayback apparatus as described in claim 1, wherein said streamanalyzing means detects frame length data contained in the header signaldenoting the length of the frame, and abandons the frame and analyzesthe next frame when the length of the data in the one frame followingthe header signal is not equal to the detected frame length data.
 6. Aplayback apparatus as described in claim 1, wherein the first streamcontains a plurality of packets, and said stream analyzing means detectspacket length data contained in the header signal denoting the packetlength, and abandons a packet and analyzes the next packet when thelength of the detected packet is not equal to the detected packet lengthdata.
 7. A playback apparatus as described in claim 6, wherein adiscontinuity identification packet is inserted in the first streamwhere a data discontinuity occurs, and when said stream analyzing meansdetects a discontinuity identification packet and the length of dataoutput to said pre-decoding buffer memory before the discontinuityidentification packet is less than a predefined data length or integermultiple thereof, said stream analyzing means outputs padding data equalto the data deficiency to said pre-decoding buffer memory.
 8. A playbackapparatus as described in claim 1, wherein a discontinuityidentification packet is inserted in the first stream where a datadiscontinuity occurs; and said stream analyzing means comprises acounter for counting from a detected header signal to a discontinuityidentification packet; said playback apparatus further comprises anaddress storage means for calculating and storing the address where thecounter stops counting; and said control means moves a read pointer sothat the next private header is located at the calculated address.
 9. Aplayback apparatus as described in claim 1, further comprising a delaymeans between said pre-decoding buffer memory and decoding means.
 10. Aplayback method for receiving data having a lower layer second streamcontained in an upper layer first stream that includes a detectableheader signal the second stream containing an encoded audio signal and aprivate header storing attribute information for the encoded audiosignal in one frame but not containing a synchronization word, decodingthe encoded audio signal, and outputting audio, said playback methodcomprising: a stream analyzing step for analyzing the first stream anddetecting the header signal, analyzing the second stream based on thedetected header signal, and outputting the encoded audio signal andprivate header address; a step for temporarily storing the encoded audiosignal and private header output from said stream analyzing step; adecoding step for decoding the stored encoded audio signal andoutputting audio; a first header analyzing step for analyzing attributeinformation contained in the private header of a first frame, anddetecting data length information denoting the data length of theencoded audio signal following the private header; a second headeranalyzing step for analyzing target data of a specified length startingfrom an address acquired by adding the detected data length to theaddress of the private header of the first frame, and determining if thetarget data is the attribute information contained in the private headerof a second frame; and a control step for stopping audio output fromsaid decoding step for at least the encoded audio signal of the firstframe if the analyzed target data is determined to not be attributeinformation contained in the private header of a second frame.
 11. Aplayback method as described in claim 10, wherein said second headeranalyzing step determines if at least a part of the target data matchesat least a part of the attribute information analyzed by said firstheader analyzing step.
 12. A playback method as described in claim 10,wherein said second header analyzing step determines if at least a partof the target data matches at least a part of a previously storedattribute information set.
 13. A playback method as described in claim10, wherein the attribute information is at least one of the following:a sampling frequency of the encoded audio signal, channel information,audio sample bit length, and encoded audio signal data length.
 14. Aplayback method as described in claim 10, wherein said stream analyzingstep detects frame length data contained in the header signal denotingthe length of the frame, and abandons the frame and analyzes the nextframe when the length of the data in the one frame following the headersignal is not equal to the detected frame length data.
 15. A playbackmethod as described in claim 10, wherein the first stream contains aplurality of packets, and said stream analyzing step detects packetlength data contained in the header signal denoting the packet length,and abandons a packet and analyzes the next packet when the length ofthe detected packet is not equal to the detected packet length data. 16.A playback method as described in claim 15, wherein a discontinuityidentification packet is inserted in the first stream where a datadiscontinuity occurs, and when said stream analyzing step detects adiscontinuity identification packet and the length of data stored beforethe discontinuity identification packet is less than a predefined datalength or integer multiple thereof, said stream analyzing step outputspadding data equal to the data deficiency to said temporary storingstep.
 17. A playback method as described in claim 10, wherein adiscontinuity identification packet is inserted in the first streamwhere a data discontinuity occurs; and said stream analyzing step countsfrom a detected header signal to a discontinuity identification packet;said playback method further comprises an address storage step forcalculating and storing the address where counting stops; and saidcontrol step moves a read pointer so that the next private header islocated at the calculated address.
 18. A playback method as described inclaim 10, further comprising a delay step for delaying the encoded audiosignal between said storing step and said decoding step.